package ym.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import ym.mapper.WardRoundRecordMapper;
import ym.pojo.WardRoundRecord;

import java.util.List;

@DubboService
public class WardRoundRecordServiceImpl implements WardRoundRecordService {
    @Autowired
    private WardRoundRecordMapper wardRoundRecordMapper;

    @Override
    public void add(WardRoundRecord wardRoundRecord) {
        wardRoundRecordMapper.insert(wardRoundRecord);
    }

    @Override
    public void update(WardRoundRecord wardRoundRecord) {
        wardRoundRecordMapper.updateById(wardRoundRecord);
    }

    @Override
    public void delete(Integer id) {
        wardRoundRecordMapper.deleteById(id);
    }


    @Override
    public WardRoundRecord findById(Integer id) {
        return wardRoundRecordMapper.selectById(id);
    }

    @Override
    public List<WardRoundRecord> findAll() {
        return wardRoundRecordMapper.selectList(null);
    }

    @Override
    public Page<WardRoundRecord> search(String search, int page, int size) {
        return wardRoundRecordMapper.selectPage(new Page<>(page, size), null);
    }
}
